import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/home/home'
import Buycar from "@/components/buycar/buycar"
import Vip from "../components/vip/Vip";
import Search from "../components/search/Search";
import News from "../components/news/News";
import NewsDesc from "../components/news/NewsDesc";
import Enjoylist from "../components/enjoy/Enjoylist";
import Enjoyitems from "../components/enjoy/Enjoyitems";
import Enjoydesc from "../components/enjoy/Enjoydesc";
import Goodslist from "../components/goods/Goodslist";
import Goodsdesc from "../components/goods/Goodsdesc";

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/buycar',
      name: 'buycar',
      component: Buycar
    },
    {
      path: '/vip',
      name: 'vip',
      component: Vip
    },
    {
      path: '/search',
      name: 'search',
      component: Search
    },
    {
      path: '/news',
      name: 'news',
      component: News
    },
    {
      path:'/news/desc',
      name:'news.desc',
      component:NewsDesc
    },
    {
      path:'/enjoy',
      name:'enjoy',
      component:Enjoylist,
      children:[
        {
          path:'/enjoyitems',
          name:'enjoyitems',
          component:Enjoyitems,
        }
      ]
    },
    {
      path:'/enjoy/desc',
      name:'enjoy.desc',
      component:Enjoydesc
    },
    {
      path:'/goods/list',
      name:'goods',
      component:Goodslist
    },
    {
      path:'/goods/desc',
      name:'goods.desc',
      component:Goodsdesc
    }
  ]
})
